// pages/wode/wode.js
const app = getApp()
Page({
url: app.globalData.url,
  /**
   * 页面的初始数据
   */
  data: {
    url: app.globalData.url,
	  login:false,//是否登陆   true：已登录   false：未登录
  },
  //报错 
  showModal() {
    wx.showModal({
      content: "请先登录",
      showCancel: false,
    })
  },
  gologin:function(){
    wx.navigateTo({
      url: '/pages/login/login',
      success: function(res) {},
    })
  },
  //跳转设置页面
	goSetting:function(e){
    if (app.isLogin()) {
      wx.navigateTo({
        url: '../setting/setting',
      })
    } else {
      this.showModal();
    }

	},
	//跳转考试查询页面
	goKaoshiChaxun: function (e) {
    if (app.isLogin()) {
      wx.navigateTo({
        url: '../kaoshiChaxun/kaoshiChaxun',
      })
    } else {
      this.showModal();
    }

	},
	//跳转活动报名页面
	huodongBaoming: function (e) {
    if (app.isLogin()) {
      wx.navigateTo({
        url: '../wodehuodongBaoming/wodehuodongBaoming',
      })
    } else {
      this.showModal();
    }
	
	},
	//学习计划页面
	xuexiJihua:function(e){
    if (app.isLogin()) {
      wx.navigateTo({
        url: '../xuexiJihua/xuexiJihua',
      })
    } else {
      this.showModal();
    }
	
	},
	//信访中心
	xinFangCenter: function (e) {
    if (app.isLogin()) {
      wx.navigateTo({
        url: '../xinFangCenter/xinFangCenter',
      })
    } else {
      this.showModal();
    }
	},
	//督办统计
	duBanTongJi: function (e) {
    if (app.isLogin()) {
      wx.navigateTo({
        url: '../duBanTongJi/duBanTongJi',
      })
    } else {
      this.showModal();
    }
	
	},
	//督办事项
	dubanShixiang: function (e) {
    if (app.isLogin()) {
      wx.navigateTo({
        url: '../dubanShixiang/dubanShixiang',
      })
    } else {
      this.showModal();
    }
	
	},
	//创建督办
	duBanAdd: function (e) {
    if (app.isLogin()) {
      wx.navigateTo({
        url: '../duBanAdd/duBanAdd',
      })
    } else {
      this.showModal();
    }
	
	},
	//会议日程
	huiyiRicheng: function (e) {
    if (app.isLogin()) {
      wx.navigateTo({
        url: '../huiyiRicheng/huiyiRicheng',
      })
    } else {
      this.showModal();
    }
	
	},
	//发起会议
	meetingAdd: function (e) {
    if (app.isLogin()) {
      wx.navigateTo({
        url: '../meetingAdd/meetingAdd',
      })
    } else {
      this.showModal();
    }
		
	},
	//工作动态
	dongTaiDetailMy: function (e) {
    if (app.isLogin()){
      wx.navigateTo({
        url: '../dongTaiDetailMy/dongTaiDetailMy',
      })
    }else{
      this.showModal();
    }
	
	},
	//发布动态
	dongTaiFabu: function (e) {
    console.log(app.isLogin());
    if (app.isLogin()) {
      wx.navigateTo({
        url: '../dongTaiFabu/dongTaiFabu',
      })
    } else {
      this.showModal();
    }
	
	},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var _this=this;
    var info = app.getLoginInfo();
    console.log(info);
    if (info != null){
      var partyName = '';
      if (info.userExtendEO.isParty==1) {
        partyName='党员';
      }
      _this.setData({
        login:true,
        nickname: info.nickname,
        partyName: partyName,
        position: info.userExtendEO.position,
        headImage: info.headImage
      })
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})